#!/bin/bash

HOST_NAME=IICM2
DEFAULT_PASSWD=123456

echo "root:$DEFAULT_PASSWD" | chpasswd

# 修改主机命名
echo "I: Edit hostname is $HOST_NAME"
echo "$HOST_NAME" > /etc/hostname

echo "I: add hosts info."
if (( $(grep "^127.*$HOST_NAME$" /etc/hosts | wc -l) == 0 )); then
    echo "127.0.0.1	$HOST_NAME" >> /etc/hosts
fi
